package busquedas;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;

import programita.AdminDeDatos;
import programita.Alumno;

public class Eliminar {
	public static void EliminarAlumno(int id){	 
			    Connection c = null;

			   
			    try {

			        c = AdminDeDatos.getInstance().getConnection();
			        String laConsulta = "DELETE FROM Alumnos WHERE id_alu="+id;
			        Statement stmtConsulta = c.createStatement();
			        stmtConsulta.execute(laConsulta);
			        laConsulta = "DELETE FROM Cobranzas WHERE id_Alu="+id;
			        stmtConsulta = c.createStatement();
			        stmtConsulta.execute(laConsulta);
			        laConsulta = "DELETE FROM Tutores WHERE id_Alu="+id;
			        stmtConsulta = c.createStatement();
			        stmtConsulta.execute(laConsulta);
		        	AdminDeDatos.getInstance().releaseConnection(c);
                                System.out.println("Eliminado con Exito");
			    } catch (Exception e) {
			        e.printStackTrace();

		            }

			
		   }

}
